<template>
  <div>
    <FormPanel ref="from" :list="formList" @formChange="changeHandle" :isSubmitBtn="false" :collapse="false" labelWidth="110" />
    <FilterTable
      ref="table"
      :columns="columns"
      :fetchapi="fetchApi"
      :params="fetchParams"
      :datakey="'records'"
      :onRowSelectChange="selectChangeHandle"
      :onColumnsChange="columns => (this.columns = columns)"
    >
    </FilterTable>
    <FormPanel ref="from" :list="formLists" :isSubmitBtn="false" :collapse="false" labelWidth="110" />

    <div style="height:47px;"></div>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }"
    >
      <el-button @click="closeDrawer(1)">关 闭</el-button>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      formList: this.createdFrom(),
      formLists: this.createdFroms(),
      columns: this.createdTable(),
      fetchParams: {},
      fetchApi: () => {},
      isaddCar: false,
      iscontract: false,
      isProject: false,
      isDiscount: false,
      isowner: false
    };
  },
  components: {},
  methods: {
    createdFrom() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '大客户订单信息'
        },
        {
          type: 'INPUT',
          label: '合同名称',
          fieldName: 'htmc',
          placeholder: '请选择',
          readonly: true,
          disabled: true,
          unitRender: () => {
            return (
              <div>
                <el-button icon="el-icon-search" onClick={() => this.seacherFun(1)}></el-button>
              </div>
            );
          },
          rules: [{ required: true, message: '请选择', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '大客户项目名称',
          fieldName: 'dkhxmmc',
          placeholder: '请选择',
          readonly: true,
          disabled: true,
          unitRender: () => {
            return (
              <div>
                <el-button icon="el-icon-search" onClick={() => this.seacherFun(2)}></el-button>
              </div>
            );
          },
          rules: [{ required: true, message: '请选择', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '大客户名称',
          fieldName: 'dkhmc',
          placeholder: '请输入',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '大客户订单编号',
          fieldName: 'dkhddbh',
          placeholder: '请输入',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '当前年月',
          fieldName: 'dqny',
          placeholder: '请输入',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '订单经销商',
          fieldName: 'ddjxs',
          placeholder: '请输入',
          disabled: true
        },
        {
          type: 'SELECT',
          label: '订单类型',
          fieldName: 'jxsmc',
          placeholder: '请选择',
          disabled: true,
          itemList: [],
          rules: [{ required: true, message: '请选择', trigger: 'change' }]
        },
        {
          type: 'SELECT',
          label: '订单细分类型',
          fieldName: 'jxsmc',
          placeholder: '请选择',
          disabled: true,
          itemList: [],
          rules: [{ required: true, message: '请选择', trigger: 'change' }]
        },
        {
          type: 'SELECT',
          label: '运输方式',
          fieldName: 'ysfs',
          placeholder: '请选择',
          disabled: true,
          itemList: [],
          rules: [{ required: true, message: '请选择', trigger: 'change' }]
        },
        {
          type: 'SELECT',
          label: '是否使用返利',
          fieldName: 'sfsyfl',
          placeholder: '请选择',
          disabled: true,
          itemList: [],
          rules: [{ required: true, message: '请选择', trigger: 'change' }]
        },
        {
          type: 'INPUT',
          label: '资金总余额',
          fieldName: 'zjzye',
          placeholder: '请选择',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '返利池余额',
          fieldName: 'flcye',
          placeholder: '请选择',
          disabled: true
        },

        {
          type: 'DATE',
          label: '要求交付日期',
          fieldName: 'yqjfrq',
          placeholder: '请选择',
          disabled: true
        },
        {
          type: 'SELECT',
          label: '开票类型',
          fieldName: 'kplx',
          placeholder: '请选择',
          disabled: true,
          itemList: [],
          rules: [{ required: true, message: '请选择', trigger: 'change' }]
        },
        {
          type: 'INPUT',
          label: '实付总金额',
          fieldName: 'sfzje',
          disabled: true
        },

        {
          type: 'BREAK_SPACE',
          label: '车辆信息'
        }
      ];
    },
    createdFroms() {
      return [
        {
          type: 'TEXT_AREA',
          label: '审核意见',
          fieldName: 'shyj',
          placeholder: '请选择',
          selfCols: 2,
          disabled: true
        }
      ];
    },
    createdTable() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },

        {
          title: '收车地址',
          dataIndex: 'scdz',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '产品代码',
          dataIndex: 'zcbm',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '产品名称',
          dataIndex: 'zcbmms',
          align: 'center',
          width: 400,
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '车型名称',
          dataIndex: 'cxmc',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '内饰',
          dataIndex: 'ns',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '外饰',
          dataIndex: 'ws',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '提报数量',
          dataIndex: 'tbsl',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '可用资源',
          dataIndex: 'kyzy',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '审核数量',
          dataIndex: 'shsl',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '已审',
          dataIndex: 'ys',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '已取消',
          dataIndex: 'yqx',
          sorter: true,
          filter: true,
          filterType: 'input'
        },

        {
          title: '状态',
          dataIndex: 'zt',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '市场指导价',
          dataIndex: 'sczdj',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '国补金额',
          dataIndex: 'gbje',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '折扣总金额',
          dataIndex: 'zkzje',
          sorter: true,
          filter: true,
          filterType: 'input',
          summation: true
        },
        {
          title: '使用返利总金额',
          dataIndex: 'syflzje',
          sorter: true,
          filter: true,
          filterType: 'input',
          summation: true
        },

        {
          title: '折后单价',
          dataIndex: 'zhdj',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '折前总金额',
          dataIndex: 'zqzje',
          sorter: true,
          filter: true,
          filterType: 'input',
          summation: true
        },
        {
          title: '折后总金额',
          dataIndex: 'zhzje',
          sorter: true,
          filter: true,
          filterType: 'input',
          summation: true
        },
        {
          title: '备注',
          dataIndex: 'remark',
          sorter: true,
          filter: true,
          filterType: 'input'
        }
      ];
    },

    seacherFun(type) {},
    changeHandle(val) {},
    closeDrawer(type) {}
  }
};
</script>
